package com.mida.app.knw.service.impl;

import com.mida.app.knw.service.KnwIndividualRelationService;
import com.mida.dms.knw.api.KnwIndividualRelationApi;
import com.mida.dms.knw.entity.vo.KnwIndividualRelationVo;
import com.mida.dms.knw.entity.vo.KnwIndividualVo;
import com.mida.dms.knw.entity.vo.MapperPage;
import com.mida.dms.knw.vo.KnwIndividualRelationPageVo;
import com.mida.dms.knw.vo.PageResultVo;
import com.mida.tool.common.result.ActionResult;
import com.mida.tool.common.result.ListResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <h1></h1>
 * <p>
 *
 * </p>
 *
 * @author jian.li on 2021/7/22 14:46
 */
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class KnwIndividualRelationServiceImpl implements KnwIndividualRelationService {

    @Autowired
    KnwIndividualRelationApi knwIndividualRelationApi;

    @Override
    public ActionResult addSingle(KnwIndividualRelationVo relation) {
        return knwIndividualRelationApi.addSingle(relation);
    }

    @Override
    public ActionResult addList(List<KnwIndividualRelationVo> relationList) {
        return knwIndividualRelationApi.addList(relationList);
    }

    @Override
    public ListResult<PageResultVo<KnwIndividualRelationVo>> findPage(KnwIndividualRelationPageVo vo) {
        return knwIndividualRelationApi.findPage(vo);
    }

    @Override
    public ListResult<KnwIndividualRelationVo> findSingle(Long individualRelationSoid) {
        return knwIndividualRelationApi.findSingle(individualRelationSoid);
    }

    @Override
    public ActionResult enable(Long soid) {
        return knwIndividualRelationApi.enable(soid);
    }

    @Override
    public ListResult<List<KnwIndividualVo>> findSourceAndTarget(MapperPage page) {
        return knwIndividualRelationApi.findSourceAndTarget(page);
    }

    @Override
    public ListResult<Object> findRelation(String searchData) {
        return knwIndividualRelationApi.findRelation(searchData);
    }

    @Override
    public ActionResult updateSingle(KnwIndividualRelationVo relation) {
        return knwIndividualRelationApi.updateSingle(relation);
    }

    @Override
    public ActionResult delete(Long individualRelationSoid) {
        return knwIndividualRelationApi.delete(individualRelationSoid);
    }
}
